import java.util.Scanner;
import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2025-03-10
 * 20:59
 */
public class Test2 {
//    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
//        // 注意 hasNext 和 hasNextLine 的区别
//        Scanner scan=new Scanner(System.in);
//        String s=scan.nextLine();
//        Stack<Character> stack=new Stack<>();
//
//        for(int i=0;i<s.length();i++){
//            Character c=s.charAt(i);
//            if(!stack.isEmpty()&&stack.peek().equals(s.charAt(i))) {
//                stack.pop();
//
//            }else {
//                stack.add(c);
//            }
//        }
//        StringBuffer b=new StringBuffer();
//        int i=stack.size();
//        for(int j=0;j<i;j++){
//            b.append(stack.pop());
//        }
//        b=b.reverse();
//        System.out.println(b.toString());
//    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        StringBuffer b=new StringBuffer();

        for(int i=0;i<s.length();i++){
            Character c=s.charAt(i);
            if(b.length()!=0&&c.equals(b.charAt(b.length()-1))){
                b.deleteCharAt(b.length()-1);
            }else{
                b.append(c);
            }
        }
        System.out.println(b.toString());
    }
}
